package com.example.demo.Controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;

@Service
public class FileHandler {

    @Autowired
    private Logger logger;

    Properties pro = new Properties();

//    public FileHandler() throws IOException {
//        pro = new Properties();
//        pro.load(new FileReader("application.properties"));
//    }

    public void save(Properties pro) throws IOException {
        pro.store(new FileOutputStream("application.properties"), "");
        logger.log(pro.toString());
    }
}
